﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DevFramework.Core.Aspects.CacheAspects;
using DevFramework.Business.Abstract;
using DevFramework.DataLayer.Abstract;
using DevFramework.DataLayer.Concrete.NHibernate;
using DevFramework.DataLayer.Concrete.NHibernate.Helper;
using DevFramework.Entities.Concrete;

namespace DevFramework.Business.Concrete.Managers
{
    
    public class UserManager : IUserService
    {
        private readonly IUserDal _userDal;

        public UserManager(IUserDal userDal)
        {
            _userDal = userDal;
        }
        
        public List<User> GetAll()
        {
            return _userDal.GetList(filter: t=>t.TcNo.StartsWith("5"));
        }

        public User Getir(string tcNo)
        {
            return _userDal.Get(t => t.TcNo==tcNo);
        }

        public User Add(User user)
        {
            return _userDal.Add(user);
        }
    }
}
